const db = require('../models');
const Record = db.Record;

// 创建新记录
exports.createRecord = async (req, res) => {
  try {
    const Record = await Record.create(req.body);
    res.status(201).send(Record);
  } catch (error) {
    res.status(400).send(error);
  }
};

// 获取所有记录
exports.getAllRecords = async (req, res) => {
  try {
    const Records = await Record.findAll();
    res.status(200).send(Records);
  } catch (error) {
    res.status(500).send(error);
  }
};
